Sub x_misc_database_functions()

End Sub

Function find_first(lookup_value, column)

For row = 1 To column.Count
  
  compare = StrComp(column(row), lookup_value, vbTextCompare)
  
  If compare = 0 Then
    find_first = row
    Exit Function
  End If
  
Next row

find_first = False

End Function

Function find_second(lookup_value, column)

For row = 1 To 4000
  compare = StrComp(column(row), lookup_value, vbTextCompare)
  
  If compare = 0 Then
   number_found = number_found + 1
   If number_found = 2 Then
    find_second = row
    Exit Function
   End If
  End If
  
Next row

find_second = False

End Function

Function find_third(lookup_value, column)

For row = 1 To 4000
  compare = StrComp(column(row), lookup_value, vbTextCompare)
  
  If compare = 0 Then
   number_found = number_found + 1
   If number_found = 3 Then
    find_third = row
    Exit Function
   End If
  End If
  
Next row

find_third = False

End Function



'
'   Auto runs when Workbook is close.
'


Sub auto_close()

    On Error Resume Next
    CommandBars("Worksheet Menu Bar").Reset
    
End Sub



